

<?php 
	$restaurantCart = isset($cart[0]) ? $cart[0] : null;
	if ($restaurantCart == null)
	{
		$restaurantCart['foodArray'] = array();
		$restaurantCart['restaurantTotalPrice'] = 0;
	}
	$oneFoodArray = $restaurantCart['foodArray']
?>

<div id='cart_wrapper_div'>
	<h2 class="block_gray_header">
	购物车
	</h2>
	<div id='cart_food_list'>
	<?php foreach ($oneFoodArray as $oneCartFood) : ?>
	    <ul>
		    <li class="cart_food_name"><?php echo $oneCartFood['name'] ?></li>
		    <li class="cart_food_price"><?php echo $oneCartFood['price'] ?>￥</li>
		    <li class="cart_food_quantity">x <?php echo $oneCartFood['quantity'] ?></li>
		    <li class="cart_food_action"><img onclick="substractFood(<?php echo $oneCartFood['foodID']; ?>,1);" src="/images/restaurantHome/button-minus.gif" alt="" width="10" height="10" /></li>
	    </ul>
	<?php endforeach; ?>
	</div>
	<h3 class="orange_font">总价格:  <?php echo $restaurantCart['restaurantTotalPrice'];?>￥</h3>
	<p><img src="/images/restaurantHome/go_checkout.png" onclick="javascript:window.location.href='<?php echo(count($oneFoodArray)==0)?"":base_url()."order/checkout";?>';" alt="" width="128" height="38" <?php if(count($oneFoodArray)==0)echo 'style="opacity:0.4;filter:alpha(opacity=40)"'?>/>
	</p>
	<div id = "cart_ajax_loading_div">
			<img alt="Indicator" src="/images/common/ajax-loading.gif">
	</div>
</div>